<?php
/* @var $this UserController */
/* @var $model User */
/* @var $form CActiveForm */
?>
<h1>Đăng ký tài khoản</h1>
<div class="form ">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'user-form',
	//'enableAjaxValidation'=>true,
	'enableClientValidation'=>true,)); ?>

	<?php //echo $form->errorSummary($model); ?>

	<div style="margin:20px;">
	<div class="row">
		<?php echo $form->labelEx($model,'username'); ?>
		<?php echo $form->textField($model,'username',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'username'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'password'); ?>
		<?php echo $form->passwordField($model,'password',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'password'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'confirm'); ?>
		<?php echo $form->passwordField($model,'confirm',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'confirm'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'email'); ?>
		<?php echo $form->emailField($model,'email'); ?>
		<?php echo $form->error($model,'email'); ?>
	</div>
	
	<div class="row">
		<?php echo $form->labelEx($model,'hoten'); ?>
		<?php echo $form->textField($model,'hoten'); ?>
		<?php echo $form->error($model,'hoten'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'ngaysinh'); ?>		
		<?php Yii::import('application.extensions.CJuiDateTimePicker.CJuiDateTimePicker');
		   	 $this->widget('CJuiDateTimePicker',array(
		        'model'=>$model, //Model object
		        'attribute'=>'ngaysinh', //attribute name
		                'mode'=>'date',//use "time","date" or "datetime" (default)
		        'options'=>array(), // jquery plugin options
		    	 'language' => ''
		    ));
		?>
	<?php echo $form->error($model,'ngaysinh'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'diachi'); ?>
		<?php echo $form->textArea($model,'diachi',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($model,'diachi'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'dienthoai'); ?>
		<?php echo $form->textField($model,'dienthoai',array('rows'=>6, 'cols'=>50)); ?>
		<?php echo $form->error($model,'dienthoai'); ?>
	</div>
	
	<?php if(CCaptcha::checkRequirements()): ?>
	<div class="row">
		<?php echo $form->labelEx($model,'verifyCode'); ?>
		<div>
		<?php $this->widget('MyCaptcha'); ?>
		<?php echo $form->textField($model,'verifyCode'); ?>
		</div>
		<?php echo $form->error($model,'verifyCode'); ?>
	</div>
	<?php endif; ?>
	
<p class="note">Thông tin bắt buộc <span class="required">*</span></p>

	<div class="row buttons">
		<?php echo CHtml::submitButton('Đăng ký'); ?>
	</div>
</div>
<?php $this->endWidget(); ?>

</div><!-- form -->